<style type="text/css">
body{background:#eee}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:3.6rem}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
.weui_cell {
  padding: 0.5rem 0.2rem;
}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	 <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">约课</div>
		<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
		<div class="weui_cells">
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>科室名</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.lesson.title}}</div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>门店</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.package_title">{{pagedata.store.title}}</div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>时间</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.day}}</div>
        </div>
		 </div>
		<div ng-if="pagedata.bodys.length==0" class="weui_cells weui_cells_form" style="margin-top:-0.5rem">
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">学员姓名</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input ng-model="pagedata.post.name" class="weui_input" type="text" placeholder="请输入学员姓名">
					</div>
                </div>
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">学员生日</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input ng-model="pagedata.post.agetime" class="weui_input" type="date" placeholder="请输入学员生日">
					</div>
                </div>
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">学员性别</label></div>
					<div class="weui_cell_bd weui_cell_primary">
								<select ng-model="pagedata.post.sex" class="form-control tpl-province">
								<option value="" selected="selected">选择性别</option>
								<option value="0" ng-selected="pagedata.post.sex==0">女</option>
								<option value="1" ng-selected="pagedata.post.sex==1">男</option>
								</select>
					</div>
                </div>
        </div>
		<div ng-if="pagedata.bodys.length>0" class="weui_cells weui_cells_form" style="margin-top:-0.5rem">
				<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">报名小孩</label></div>
					<div class="weui_cell_bd weui_cell_primary">
								<select ng-model="pagedata.post.bodyid" class="form-control tpl-province">
								<option value="" selected="selected">选择小孩</option>
								<option ng-repeat="item in pagedata.bodys" value="{{item.id}}" ng-selected="pagedata.post.bodyid==item.id">{{item.name}}</option>
								</select>
					</div>
                </div>
        </div>
		<div class="weui_cells">
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>约课费用</span>
                </div>
                <div class="weui_cell_ft">{{pagedata.lesson.price || '0.00'}}元</div>
        </div>
		</div>
		<div class="weui_btn_area">																			
			 <a ng-if="pagedata.lesson.price<=0" class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.pay_submit(pagedata.post,'post','/order//fromcreate=1')">确认</a>
			  <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.pay_submit(pagedata.post,'post','/order//fromcreate=1')">确认约课</a>
		</div>
</div>
</div>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'confirmpay'">
	 <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">支付</div>
		<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>科室名</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.lesson.title}}</div>
        </div>

		<!--<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">上门地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.post.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
        </div>
		-->
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>约课费用</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.money">{{pagedata.lesson.price || '0.00'}}元</div>
        </div>
		<div class="weui_cell">
                <div style="visibility:hidden" class="weui_cell_hd"><label class="weui_label">预约费用</label></div>
                <div style="visibility:hidden" class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.money" class="weui_input" type="text" placeholder="" readonly>
                </div>
        </div>
		
		<div class="weui_btn_area">																			
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.pay()">支付</a>
		</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
if(scope.pagedata.basic.dingwei!=1){
window.scope.location(function(res){
		scope.$apply(function(){
			scope.pagedata.post.address = res.address;
		});
});
}else{
}
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		scope.tool.pay(result.pay_id,function(res){
				if(res.type=='success'){
					scope.message(res.message,'success','/order/detail/fromcreate=1&payid='+result.pay_id);
				}else{
					scope.message(res.message,'success','/order/detail/fromcreate=1&payid='+result.pay_id);
				}
			});
	});
}

</script>